package com.qf.controller;

import com.qf.model.Stage;
import com.qf.page.PageResult;
import com.qf.page.QueryPageBean;
import com.qf.service.StageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("stage")
public class StageController {
    @Autowired
    private StageService stageService;

    @GetMapping("findAll")
    public List<Stage> findAll(){
        List<Stage> stages = stageService.getAll();
        return stages;
    }

    @PostMapping("all")
    public PageResult all(@RequestBody QueryPageBean queryPageBean){
        PageResult result =  stageService.findPage(queryPageBean);
        return result;
    }

}
